package com.yungu.swift.socket.communication.message;

import com.yungu.swift.socket.communication.message.base.Message;
import com.yungu.swift.socket.communication.message.base.MessageType;

import java.io.Serializable;

/**
 * @author Zerrion
 */
public class UploadLocationMessage extends Message implements Serializable {

    public UploadLocationMessage() {
        super();
        super.setType(MessageType.UPLOAD_LOCATION);
    }

    /**
     * 基础字段，包括：
     * 位置点uuid locationUuid
     * 司机uuid driverUuid
     * 司机类型（1出租车、2专车、3拼车等） driverType
     * 订单uuid orderUuid
     * 乘客uuid passengerUuid
     * 与上一点的距离 distance
     * 纬度 lat
     * 经度 lng
     * 角度 angle
     * appid appid
     */
    private String locationUuid;
    private String driverUuid;
    private int driverType;
    private String orderUuid;
    private String passengerUuid;
    private Double distance;
    private Double lat;
    private Double lng;
    private Double angle;
    private String appid;

    /**
     * 新加字段，包括：
     * 订单中累计距离 mileage
     * 上传时间（时间戳） uploadTime
     * 订单状态（0:进行中[出发－送达]订单外；210：司机出发、去接乘客；220：司机到达、等待乘客；300：乘客上车、行程开始；400：司机送达目的地） orderStatus
     */
    private Double mileage;
    private Long uploadTime;
    private int orderStatus;

    /**
     * 监管平台字段,包括：
     * 区域编码 areaCode
     * 海拔高度 elevation
     * 瞬时速度 speed
     * 营运状态 1：载客、2：接单、3：空驶（未接到乘客）、4：停运 bizStatus
     * 位置信息类型  SJSB司机上班,SJXB司机下班,CKSC乘客上车,CKXC乘客下车,AUTO定时上传,DDPD派单 positionType
     * 车型 1舒适型 2商务型 3豪华型 carModelType
     * app版本 appVersion
     * 手机版本  phoneVersion
     */
    private String areaCode;
    private Double elevation;
    private Double speed;
    private String bizStatus;
    private Double accuracy;
    private String positionType;
    private String carModelType;
    private String appVersion;
    private String phoneVersion;

    /**
     * 跨城拼车字段
     */
    //主订单ID
    private String mainOrderUuid;
    //主订单状态 400已安排（待出发）、410行程开始（待接驾）、500行程开始、600行程结束（已完成）
    private String mainJoinStatus;
    //子订单状态 420到达上车点（待上车）、430已上车、600行程结束（已完成）
    private String joinStatus;

    public UploadLocationMessage(String locationUuid, String driverUuid, int driverType, String orderUuid, String passengerUuid,
                                 Double distance, Double lat, Double lng, Double angle, String appid, Double mileage, Long uploadTime, int orderStatus) {
        this.locationUuid = locationUuid;
        this.driverUuid = driverUuid;
        this.driverType = driverType;
        this.orderUuid = orderUuid;
        this.passengerUuid = passengerUuid;
        this.distance = distance;
        this.lat = lat;
        this.lng = lng;
        this.angle = angle;
        this.appid = appid;
        this.mileage = mileage;
        this.uploadTime = uploadTime;
        this.orderStatus = orderStatus;
    }

    public UploadLocationMessage(MessageType type, String clientUuid, String locationUuid, String driverUuid, int driverType, String orderUuid, String passengerUuid,
                                 Double distance, Double lat, Double lng, Double angle, String appid, Double mileage, Long uploadTime, int orderStatus, String areaCode,
                                 Double elevation, Double speed, String bizStatus, Double accuracy, String positionType, String carModelType, String appVersion, String phoneVersion) {
        super(type, clientUuid);
        this.locationUuid = locationUuid;
        this.driverUuid = driverUuid;
        this.driverType = driverType;
        this.orderUuid = orderUuid;
        this.passengerUuid = passengerUuid;
        this.distance = distance;
        this.lat = lat;
        this.lng = lng;
        this.angle = angle;
        this.appid = appid;
        this.mileage = mileage;
        this.uploadTime = uploadTime;
        this.orderStatus = orderStatus;
        this.areaCode = areaCode;
        this.elevation = elevation;
        this.speed = speed;
        this.bizStatus = bizStatus;
        this.accuracy = accuracy;
        this.positionType = positionType;
        this.carModelType = carModelType;
        this.appVersion = appVersion;
        this.phoneVersion = phoneVersion;
    }

    public String getAppVersion() {
        return appVersion;
    }

    public void setAppVersion(String appVersion) {
        this.appVersion = appVersion;
    }

    public String getPhoneVersion() {
        return phoneVersion;
    }

    public void setPhoneVersion(String phoneVersion) {
        this.phoneVersion = phoneVersion;
    }

    public String getCarModelType() {
        return carModelType;
    }

    public void setCarModelType(String carModelType) {
        this.carModelType = carModelType;
    }

    public String getPositionType() {
        return positionType;
    }

    public void setPositionType(String positionType) {
        this.positionType = positionType;
    }

    public Double getAccuracy() {
        return accuracy;
    }

    public void setAccuracy(Double accuracy) {
        this.accuracy = accuracy;
    }

    public String getAreaCode() {
        return areaCode;
    }

    public void setAreaCode(String areaCode) {
        this.areaCode = areaCode;
    }

    public Double getElevation() {
        return elevation;
    }

    public void setElevation(Double elevation) {
        this.elevation = elevation;
    }

    public Double getSpeed() {
        return speed;
    }

    public void setSpeed(Double speed) {
        this.speed = speed;
    }

    public String getBizStatus() {
        return bizStatus;
    }

    public void setBizStatus(String bizStatus) {
        this.bizStatus = bizStatus;
    }

    public String getDriverUuid() {
        return driverUuid;
    }

    public void setDriverUuid(String driverUuid) {
        this.driverUuid = driverUuid;
    }

    public String getOrderUuid() {
        return orderUuid;
    }

    public void setOrderUuid(String orderUuid) {
        this.orderUuid = orderUuid;
    }

    public String getLocationUuid() {
        return locationUuid;
    }

    public void setLocationUuid(String locationUuid) {
        this.locationUuid = locationUuid;
    }

    public Double getLat() {
        return lat;
    }

    public void setLat(Double lat) {
        this.lat = lat;
    }

    public Double getLng() {
        return lng;
    }

    public void setLng(Double lng) {
        this.lng = lng;
    }

    public Double getAngle() {
        return angle;
    }

    public void setAngle(Double angle) {
        this.angle = angle;
    }

    public Double getDistance() {
        return distance;
    }

    public void setDistance(Double distance) {
        this.distance = distance;
    }

    public int getDriverType() {
        return driverType;
    }

    public void setDriverType(int driverType) {
        this.driverType = driverType;
    }

    public String getPassengerUuid() {
        return passengerUuid;
    }

    public void setPassengerUuid(String passengerUuid) {
        this.passengerUuid = passengerUuid;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public Double getMileage() {
        return mileage;
    }

    public void setMileage(Double mileage) {
        this.mileage = mileage;
    }

    public Long getUploadTime() {
        return uploadTime;
    }

    public void setUploadTime(Long uploadTime) {
        this.uploadTime = uploadTime;
    }

    public int getOrderStatus() {
        return orderStatus;
    }

    public void setOrderStatus(int orderStatus) {
        this.orderStatus = orderStatus;
    }

    public String getMainOrderUuid() {
        return mainOrderUuid;
    }

    public void setMainOrderUuid(String mainOrderUuid) {
        this.mainOrderUuid = mainOrderUuid;
    }

    public String getMainJoinStatus() {
        return mainJoinStatus;
    }

    public void setMainJoinStatus(String mainJoinStatus) {
        this.mainJoinStatus = mainJoinStatus;
    }

    public String getJoinStatus() {
        return joinStatus;
    }

    public void setJoinStatus(String joinStatus) {
        this.joinStatus = joinStatus;
    }

    @Override
    public String toString() {
        return "UploadLocationMessageDto{" +
                "locationUuid='" + locationUuid + '\'' +
                ", driverUuid='" + driverUuid + '\'' +
                ", driverType=" + driverType +
                ", orderUuid='" + orderUuid + '\'' +
                ", passengerUuid='" + passengerUuid + '\'' +
                ", distance=" + distance +
                ", lat=" + lat +
                ", lng=" + lng +
                ", angle=" + angle +
                ", appid='" + appid + '\'' +
                ", mileage=" + mileage +
                ", uploadTime=" + uploadTime +
                ", orderStatus=" + orderStatus +
                ", areaCode='" + areaCode + '\'' +
                ", elevation=" + elevation +
                ", speed=" + speed +
                ", bizStatus='" + bizStatus + '\'' +
                ", accuracy=" + accuracy +
                ", positionType='" + positionType + '\'' +
                '}';
    }
}
